function [coeff,se,r_square,r_square_res] = beta_gen(y,x)

% General beta function that calculates four things
% 1. Beta
% 2. Se on beta
% 3. R squared of regression
% 4. Restricted R^2

[coeff,se] = beta_hac(y,x);
coeff = coeff'; % Adjust for odd feature that beta_hac gives coeff as a row vector

r_square = corr(y,x).^2;
r_square_res = 1 - var(y-x)'/var(y);

end

